package com.eui.arch.util
{

	/**
	 * The managedPM's lifecycle is managed by PMContext
	 * @author David Zhang
	 */
	public class ManagedPM
	{
		public function pmId():String
		{
			throw new Error("method pmId() in ManagedPM must be overriden by child class");
		}

		/**
		 * Lifecycle management
		 */
		public function addToPMContext():void
		{
			PMContext.getInstance().putPM(pmId(), this);
		}

		/**
		 * Lifecycle management
		 */
		public function removeFromPMContext():void
		{
			PMContext.getInstance().removePM(pmId());
		}
	}
}